From 378eb68948928078f2800fb7289fc64cb3324ab6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 7 Sep 2007 18:32:36 +0000 Subject: [PATCH] Check for the cups function httpGetAuthString(). 2007-09-07 Matthias Clasen * configure.in: Check for the cups function httpGetAuthString(). * modules/printbackends/cups/gtkcupsutils.c: Use httpGetAuthString() if available. (#467414, Claudio Saavedra) svn path=/trunk/; revision=18753 --- ChangeLog | 7 +++++++ configure.in | 5 +++++ modules/printbackends/cups/gtkcupsutils.c | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fab6466cee..b1af63729f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-09-07 Matthias Clasen + + * configure.in: Check for the cups function httpGetAuthString(). + + * modules/printbackends/cups/gtkcupsutils.c: Use httpGetAuthString() + if available. (#467414, Claudio Saavedra) + 2007-09-07 Kristian Rietveld * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_init), diff --git a/configure.in b/configure.in index cf4491154c..e3337a0f42 100644 --- a/configure.in +++ b/configure.in @@ -1583,6 +1583,11 @@ CFLAGS="$gtk_save_cflags" AC_SUBST(HAVE_HTTP_AUTHSTRING) +gtk_save_libs="$LIBS" +LIBS="$CUPS_LIBS" +AC_CHECK_FUNCS(httpGetAuthString) +LIBS="$gtk_save_libs" + gtk_save_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS" diff --git a/modules/printbackends/cups/gtkcupsutils.c b/modules/printbackends/cups/gtkcupsutils.c index 32d433f1fe..8fc76f0b41 100644 --- a/modules/printbackends/cups/gtkcupsutils.c +++ b/modules/printbackends/cups/gtkcupsutils.c @@ -629,9 +629,13 @@ _post_send (GtkCupsRequest *request) httpClearFields (request->http); httpSetField (request->http, HTTP_FIELD_CONTENT_LENGTH, length); - httpSetField (request->http, HTTP_FIELD_CONTENT_TYPE, "application/ipp"); + httpSetField (request->http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");` +#ifdef HAVE_HTTPGETAUTHSTRING + httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString (request->http)); +#else #ifdef HAVE_HTTP_AUTHSTRING httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, request->http->authstring); +#endif #endif if (httpPost (request->http, request->resource)) -- 2.30.2